#!/bin/bash -eux

exec 2>&1 | tee =log$$

protos=data/protos*[ab].h5

for pca in 5 3 15 20 10; do
    for i in $protos; do
	base=$(basename $i .h5)
	echo === $i $pca
	time llnnlin -v 0 --pca $pca -p $i data/training.h5 -o $base.lin$pca.h5
	lldump -c ll $base.lin$pca.h5 $base.lin$pca.cmodel
	time llclassify -v 0 -c $base.lin$pca.cmodel data/testing.h5
	time llclassify -v 0 -c $base.lin$pca.cmodel data/training.h5
    done
done
